package clientText;

import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class InterNetClint_1 {

	public static void main(String[] args) {

		String ip="172.21.12.251";
		int dk=9700;

		Scanner in;
		PrintWriter out;

		try(Socket connect=new Socket(ip,dk)){

			in=new Scanner(connect.getInputStream());
			out=new PrintWriter(connect.getOutputStream());

			Runnable run_1=new ReadRunable(in);
			Runnable run_2=new WriteRunable(out);
			(new Thread(run_1)).start();
			(new Thread(run_2)).start();

		} catch (UnknownHostException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}

}
